<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<html>
<head>

<title>库房分配</title>
<style type="text/css">
td {
	font-size: 14px;
	text-align: center;
}

input {
	text-align: center;
}

table {
	text-align: center;
}

#sousuo1 {
	background-image: img/search-icon.png;
	position: relative;
	top: -18px;
	left: -15px
}

#xinxi{
				display: none;
				background-color: powderblue;
				position: absolute;
				left:700PX;
				top: 180px;
			}
			
</style>
<link type="text/css" rel="stylesheet" href="css/style.css" />
<link type="text/css" rel="stylesheet" href="css/index.css" />
<script src="js/jquery.min.js"></script>
<!-- 动态菜单JS -->
<script type="text/javascript" src="js/menu.js"></script>
</head>

<body>

	<div class="container">
		<div class="cont-top">
			<div class="companyname">ERP管理系统</div>
			<div class="cont-top-middle">
				<ul>
					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon.png">
							</div>
							<div class="top-txt">购物单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

				</ul>
			</div>
			<div class="cont-top-rg">
				<ul class="advanced-menu">
					<li>
						<div class="top-search">
							<div class="t-s-l">
								<span class="left-line"></span> <input type="text" value="搜库存"
									class="search-type" disabled> <span
									class="triangle-bottom"></span>
							</div>
							<div class="t-s-l">



								<form action="BuyServlet?act=sousuo" method="post">
									<input type="text" placeholder="请输入商品编码或名称" name="sou"
										class="search-dt"> <span class="right-line"></span> <span
										class="right-icon"> <span class="right-line"> <input
											type="submit" value="搜索" id="sousuo1" /></span>
								</form>





							</div>
						</div>
					</li>
					<li class="default" style="position: relative;"><span
						class="user"><img src="img/user.png"></span> <a
						 class="special" onclick="denglu()" >${user.name} <i><img
							 	src="img/xl.png"></i></a>
						<div class="drop-down-wrap"
							style="width: 180px; left: 15px; display: none;">
							<div class="drop-down">
								<span class="triangle-border"></span> <span class="triangle-bg"></span>
								<ul class="del-ul">
									<li><a href="#" class="hot">首耀照明</a></li>
									<li><a href="#">小丫头</a></li>
									<li><a href="#">操作日志</a></li>
								</ul>
							</div>
						</div></li>
				</ul>
				<ul class="advanced-menu">
					<li><a href="#"><img src="img/top-icon1.png"></a></li>
					<li><a href="#"><img src="img/top-icon2.png"></a></li>
					<li><a href="#"><img src="img/top-icon3.png"></a></li>
					<li><a href="#"><img src="img/top-icon4.png"></a></li>
					<li><a href="#"><img src="img/top-icon5.png"></a></li>
				</ul>
			</div>
		</div>
		<div class="left-menu" style="height: 949px;">
			<div class="menu-list">
				<ul>
					<li class="menu-list-01">

						<p class="fumenu">库房管理</p> <img class="xiala" src="img/xiala.png" />

						<div class="list-p">
							<a href="BuyServlet?act=kufang">
								<p class="zcd" id="zcd5">入库单</p>
							</a>
							<p class="zcd" id="zcd6">出库单</p>
							<p class="zcd" id="zcd7">库存余额表</p>
						</div>
					</li>

					<li class="menu-list-02"><a href="ckgl.html">
							<p class="fumenu">产品管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd5">产品库存</p>
							<p class="zcd" id="zcd6">产品成本</p>
							<p class="zcd" id="zcd7">产品属性管理</p>
						</div></li>

					<li class="menu-list-01"><a href="dd-ddgl.html">
							<p class="fumenu">订单管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd8">下单账户</p>
							<p class="zcd" id="zcd9">所属员工</p>
							<p class="zcd" id="zcd10">订单成本</p>
							<p class="zcd" id="zcd1">订单成本费用</p>
							<p class="zcd" id="zcd12">订单总支付金额</p>
							<p class="zcd" id="zcd3">订单商品</p>
							<p class="zcd" id="zcd14">手动增加订单</p>
						</div></li>

					<li class="menu-list-02"><a href="cj-ckd.html">
							<p class="fumenu">财务管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd15">记录出款和入款</p>
							<p class="zcd" id="zcd16">计算一段时间的利润</p>
						</div></li>

					<li class="menu-list-01"><a href="kh-khgl.html">
							<p class="fumenu">客户管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd17">客户基本信息</p>
							<p class="zcd" id="zcd18">客户VIP登记管理</p>
							<p class="zcd" id="zcd19">客户信息管理</p>
							<p class="zcd" id="zcd20">客户订单管理</p>
							<p class="zcd" id="zcd21">转移客户</p>
						</div></li>

					<li class="menu-list-02"><a href="yg-jbxx.html">
							<p class="fumenu">员工管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd22">员工基本信息</p>
							<p class="zcd" id="zcd23">员工权限</p>
							<p class="zcd" id="zcd24">开通新客户</p>
							<p class="zcd" id="zcd25">销售额管理</p>
						</div></li>
				</ul>
			</div>
		</div>

		<div class="right-menu">
			<div class="main-hd">
				<div class="page-teb">
					<div class="l-tab-links">
						<ul style="left: 0;">
							<li class="l-select"><a href="index.jsp"
								style="padding: 0px 25px;">首页</a></li>
							<li class="l-select"><a href="#">库房分配</a> <span
								class="close"></span></li>
						</ul>
					</div>

					<div class="l-tab-content" style="background: #fff;">
						<div class="tab-content-item">
							<div class="home">
								<!--库房分配   开始-->
								<div class="kufang-box">
									<div class="kufang">
										<div class="kf-fl">
											<ul>
												<li>价格方式：<span>库存成本价</span></li>
												<li style="display: none;">仓库：<span>天津站</span></li>
												<li style="display: none;">时间：<span>2016-08-15至2017-08-25</span></li>
											</ul>
										</div>

										<div class="kf-rg">
											<ul>
												<li><span><input type="checkbox"
														onclick="baofei()">选择报废</span></li>
												<li><span><input type="button"  onclick="tijiao()" value="报废提交" ></span>
												</li>
												<li><span>过滤 <select class="kf-in" id="change"
														onchange="change(this.value)">
															<option>选择过滤</option>
															<option>显示全部</option>
															<option>已领用</option>
															<option>未领用</option>
															<option>已报废</option>
													</select>
												</span></li>
											</ul>
										</div>
									</div>
								</div>

								<div class="kf-tab">
									<div class="headerbar-kf">
										<table class="headerbar" border="0" cellpadding="0"
											cellspacing="1">
										</table>
									</div>


									<div class="kfbody" tabindex="0">
										<table border="0" cellpadding="0" cellspacing="1"
											class="fkbody-rows" style="width: 100%;">
											<tbody>


												<td class="caption cao-l">

													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;" id="anhao"
														name=${anhao}  >产品编号</div>
												</td>

												<td class="caption cao-l">

													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">资产编码</div>
												</td>
												<td class="caption cao-l">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">商品名称</div>
												</td>
												<td class="caption cao-l">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">凭证号</div>
												</td>
												<td class="caption cao-l">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">采购时间</div>
												</td>
												<td class="caption cao-l">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">序列号</div>
												</td>
												<td class="caption cao-l">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">财务编码</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">单价</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">数量</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">总价</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">使用状况</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">资产归属</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">资产号码</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">使用人</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">资产类别</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">入库时间</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">是否报废</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">操作日志</div>
												</td>

												</tr>
											</tbody>

											<tbody>
												<form action="BuyServlet?act=tijiao"  id="tijiao" method="post"
													id="container" onsubmit="return checkSubmit();">
													<c:set var="a" value="1"></c:set>
													<c:forEach var="p" items="${list1}">
														<tr class="fkbody-s" _rowindex="0">
															<td class="caption-kf" style="overflow: hidden;"
																align="center">
																<div class="caotion-kf-txt1">${a}</div>
															</td>
															<td class="bodyrow-list" _columnindex="0">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: center;">
																	<input type="text" id=zichan${a}
																		value=${p.zichanbianma
																		}
																		readonly="readonly" />
																</div>
															</td>
															<td class="bodyrow-list" _columnindex="1">
																<div class="bodytxt" id="ming${a}"
																	style="overflow: hidden; text-align: center;">${p.zichanming}</div>
															</td>
															<td class="bodyrow-list" _columnindex="2">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: center;">${p.pingzhenghao}</div>
															</td>

															<td class="bodyrow-list" _columnindex="4">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: center;">${p.data}</div>
															</td>

															<td class="bodyrow-list" _columnindex="5">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: center;">${p.xuliehao}</div>
															</td>
															<td class="bodyrow-list" _columnindex="6">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: right;">${p.caiwubianma}</div>
															</td>
															<td class="bodyrow-list" align _columnindex="7">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: right;">${p.danjia}</div>
															</td>
															<td class="bodyrow-list" align _columnindex="8">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: right;">${p.shuliang}</div>
															</td>
															<td class="bodyrow-list" align _columnindex="9">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: right;">${p.zongjia}</div>
															</td>
															<td class="bodyrow-list" align _columnindex="10">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: right;">
																	<input type="text" id=shiyong${a}
																		value='${p.shiyongzhuangkuang}' readonly="readonly"
																		onclick="erea()" />
																</div>
															</td>
															<td class="bodyrow-list" align _columnindex="11">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: right;">${p.zichanguishu}</div>
															</td>
															<td class="bodyrow-list" align _columnindex="12"
																name="text" value="1">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: right;">${p.zichanxinghao}</div>
															</td>
															<td class="bodyrow-list" align _columnindex="13">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: right;">
																	<input type="text" readonly="readonly" onclick="erea()"
																		value="${p.shiyongren}" />
																</div>
															</td>
															<td class="bodyrow-list" align _columnindex="14">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: right;">${p.zichanleibie}</div>
															</td>
															<td class="bodyrow-list" align _columnindex="15">
																<div class="bodytxt"
																	style="overflow: hidden; text-align: right;">${p.rukushijian}</div>
															</td>
															<td	 class="caption cao-l" colspan="1" rowspan="1">
																<div class="caotion-kf-txt"
																	style="overflow: hidden; text-align: center;">
																	<input type="button" onclick="erea(this.id)" id=${a} value="报废" >
																</div>


															</td>
															<td class="caption cao-l" colspan="1" rowspan="1">
																<div class="caotion-kf-txt"
																	style="overflow: hidden; text-align: center;">
																	<input type="button" " value="日志">

																</div>


															</td>
														</tr>
														<c:set var="a" value="${a+1}"></c:set>
													</c:forEach>
												</form>
												
											</tbody>

										</table>
										
										
										
									</div>


									<div class="lu">
										共<i>${a-1}</i>条记录
									</div>

								</div>
								<div class="tab-btn">
									<div class="bt-f">
										<ul>
											<li><a href="BuyServlet?act=daochu" class="special"><button
														class="button-li">选择导出</button></a></li>
											<li>
												<button class="button-li">明细账本</button>
											</li>
											<li>
												<button class="button-li">价格方式</button>
											</li>
										</ul>
									</div>
									<div class="bt-rg">
										<ul>
											<li><button>打印</button></li>
											<li><button>退出</button></li>
										</ul>
									</div>
								</div>
								<!--库房分配   结束-->
								<form action="BuyServlet?act=baofei_queren" method="post"  id="xinxi" >
	<table border="1" cellspacing="0px" cellpadding="0px" style="text-align: center; width: 300; height: 310px;">
 
 	
		baofei zichan yuanyin xing
 		<tr><td style="background-color: white;" >报&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;废&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;清&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;单 </td><td><button type="button" onclick="yincang()"  style="float: right; height: 100%; border: 0PX; width: 100%;">X</button></td></tr>
 		<tr><td colspan="2">报废名称</td></tr>
		<tr><td colspan="2"><input type="" name="baofei" id="ming" value=""  style="width: 100%;height: 100%;"/></td></tr>
		<tr><td colspan="2">资产编码</td></tr>
		<tr><td colspan="2"><input type="" name="zichan" id="zichan" value="" style="width: 100%;height: 100%;" /></td></tr>
		<tr><td colspan="2">报废原因</td></tr>
		<tr><td colspan="2"><input type="" name="yuanyin" id="" value="" style="width: 100%;height: 100%;" /></td></tr>
		
		
		<tr><td colspan="2">操作人姓名</td></tr>
		<tr><td colspan="2"><input type="" name="xing" id="" value=""  style="width: 100%;height: 100%;" /></td></tr>
		<tr><td colspan="2"	><input type="button" name="" id="" value="是否确认提交"  onclick="queren()"  style="width: 100%;height: 100%;" /></td></tr>
		
			
 	</table>
	</form>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		
	</div>
	

</body>
<script>
var a =3;
for (var i=0;i<=a;i++){
	
	var vle= document.getElementById("shiyong"+i)
	if(vle!=null){
		a++;
		if(vle.value=="已报废"){
			
			var length=vle.id.indexOf("g");
			
			var nid =vle.id.substring(length+1,vle.id.length);
			
			document.getElementById(nid).value="已报废";
			
		}else{
			continue;
		}
		
		
	}
	
	
}



	function queren(){
		
		var bl = confirm('确认报废吗')
		
		if(bl==true){
			document.getElementById("xinxi").submit()
		}
		
	}
	function erea(id){
		
		var neirong = document.getElementById(id).value
		if(neirong=="报废"){
			
		
		var name=document.getElementById("ming"+id).innerHTML
		document.getElementById("ming").value=name
		var name1=document.getElementById("zichan"+id).value
		document.getElementById("zichan").value=name1
		document.getElementById("xinxi").style.display="block"
		}else if(neirong=="已报废"){
			
			alert("已报废不可修改")
			}
	}

	function yincang(){ 
		document.getElementById("xinxi").style.display="none"
			
					
	}

			
	function denglu(){
		 
		 var bl = confirm('确认重新登陆吗')
			
			if(bl==true){
				window.location.href="login.jsp";
			}
		 
		 
	 }	

	function tijiao(){
		
		
		var c = 0;
		var a = 3;
		for (var i = 1; i <= a; i++) {
			a++;
			var d = document.getElementById(i);
			
			if (d != null) {
				if (d.checked == true) {
					c++;
					document.getElementById("zichan" + i).name = "zichan" + c;

				}
			} else {
				break;
			}

		}
		document.getElementById("tijiao").submit()
	}
	

	function change(value) { //筛选 领用或未领用
		var a = document.getElementById("change").value
		if (a == "未领用") {
			document.getElementById("change").value = "未领用";
			window.location.href = "BuyServlet?act=weilingyong";

		}
		if (a == "已领用") {
			document.getElementById("change").value = "已领用";
			window.location.href = "BuyServlet?act=yilingyong";

		}
		if (a == "显示全部") {

			window.location.href = "BuyServlet?act=kufang";

		}
		if (a == "已报废") {

			window.location.href = "BuyServlet?act=baofei_cha";

		}

	}
</script>

</html>
